/**
 * @license
 * Copyright 2024 The Model Explorer Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ==============================================================================
 */

.container {
  flex-grow: 1;
  display: flex;
  position: relative;
  width: 100%;
  height: 100%;
  background-color: var(--me-surface-color);

  .pane-container {
    position: relative;
    display: flex;
    flex-direction: column;

    .pane-title-container {
      height: 24px;
      box-sizing: border-box;
      background-color: var(--me-surface-container-high-color);
      padding: 0 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 12px;
      color: var(--me-on-surface-variant-color);
      cursor: pointer;
      flex-shrink: 0;

      &.extra-left-padding {
        padding-left: 36px;
      }

      &.extra-right-padding {
        padding-right: 36px;
      }

      .buttons-container {
        display: flex;
        align-items: center;
      }

      .icon-container {
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--me-on-surface-variant-color);
        opacity: 0.8;
        margin-left: 6px;

        &:hover {
          opacity: 1;
        }

        mat-icon {
          font-size: 18px;
          height: 18px;
          width: 18px;
        }
      }

      .divider {
        width: 1px;
        height: 12px;
        background-color: var(--me-outline-color);
        margin: 0 4px 0 12px;
      }
    }

    split-pane {
      width: 100%;
      flex-grow: 1;
      display: flex;
      overflow: hidden;
    }

    &.selected {
      mat-icon {
        color: var(--me-on-surface-inverse-color);
      }

      .pane-title-container {
        background-color: var(--me-active-panel-bar-bg-color);
        color: var(--me-on-surface-inverse-color);

        .divider {
          background-color: var(--me-on-surface-inverse-color);
        }
      }
    }

    .loading {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 150;
      color: var(--me-on-surface-color);
      background-color: var(--me-surface-color);
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;

      .processing-msg-container {
        display: flex;
        align-items: center;

        mat-spinner {
          margin-right: 8px;
        }
      }

      .progress-bar-wrapper {
        display: flex;
        align-items: center;
        margin-top: 18px;
        margin-right: -30px;

        .icon-container {
          cursor: pointer;
          opacity: 0.8;
          display: flex;
          align-items: center;
          justify-content: center;

          &:hover {
            opacity: 1;
          }

          mat-icon {
            color: var(--me-on-surface-variant-color);
            font-size: 18px;
            width: 18px;
            height: 18px;
            margin-left: 6px;
          }
        }
      }

      .progress-bar-container {
        height: 7px;
        width: 280px;
        border: 1px solid var(--me-outline-variant-color);
        border-radius: 99px;
        box-sizing: border-box;
        overflow: hidden;

        .progress-bar-body {
          height: 100%;
          transition: width 100ms;
          background-color: var(--me-outline-variant-color);
        }
      }

      .stay-on-page-info {
        font-size: 12px;
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 4px;
        color: var(--me-on-surface-variant-color);
      }

      .error-msg {
        font-size: 13px;
        padding: 16px;
        color: var(--me-error-text-color);
      }
    }
  }

  .resizer {
    height: 100%;
    width: 10px;
    top: 0;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    padding-left: 1px;
    cursor: ew-resize;
    z-index: 200;

    &:hover {
      background-color: rgba(0, 0, 0, 0.04);

      .resizer-line {
        border-color: var(--me-active-panel-bar-bg-color);
      }
    }

    .resizer-line {
      height: 100%;
      width: 1px;
      border-left: 1px solid var(--me-outline-color);
    }
  }

  .sync-navigation-container {
    position: absolute;
    transform: translate(-22px, 0);
    top: 0px;
    height: 24px;
    // Over resizer.
    z-index: 250;

    .no-mapped-node-message {
      position: absolute;
      top: 28px;
      width: 140px;
      font-size: 12px;
      left: -44px;
      background-color: var(--me-error-container-color);
      color: var(--me-error-text-color);
      padding: 2px 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 99px;
      pointer-events: none;
      opacity: 0;
      transition: opacity 100ms;

      &.show {
        opacity: 1;
      }
    }
  }
}

::ng-deep .model-explorer-processing-tasks-container {
  display: flex;
  flex-direction: column;
  padding: 12px;

  .processing-task-container {
    display: flex;
    align-items: center;
    font-size: 13px;
    margin: 2px 0;

    mat-spinner {
      margin-right: 8px;
      width: 16px;
    }

    mat-icon {
      color: var(--me-success-text-color);
      font-size: 16px;
      width: 16px;
      height: 16px;
      margin-right: 8px;
    }
  }
}
